def Identity():
    i = 0
    print('~' * 7, '登陆 ', '~' * 7)
    while i < 3:
        name = input('请输入用户名：')
        code = input('请输入密码：')
        username = '1234'
        usercode = '1234'
        if name == username and code == usercode:
            print('登录成功！')
            break
        elif name == username and code != usercode:
            print('用户名或密码错误！')
        elif name != username and code == usercode:
            print('用户名或密码错误！')
        elif name != username and code != usercode:
            print('用户名或密码错误！')
        i += 1
        if i >= 3:
            print('您已输入错误三次，没机会了！')


Identity()